<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加文章内容</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
	font-size:12px;
}
a{
	color:#333;
	text-decoration:none;
	}
dl{
	border:1px #90A2AE solid;
	padding:10px;
	margin:10px;
	background:#F2F5F7;
	}
dt{
	height:30px;
	background:#8BA2B9;
	display:block;
	clear:both;
	border-top:1px #D1DAE3 solid;
	}
dd{
	border:1px #D1DAE3 solid;
	border-top:0px;
	border-bottom:0px;
	padding:5px 0px 5px 20px;
	margin-left:0px;
	display:block;
	clear:both;
	background:#F5F7FA;
	}
p{
	margin:10px;
	font-size:14px;
	font-weight:bold;
	background:url(<?php echo $baseurl ?>images/admin_image/icon_top.jpg) left center no-repeat;
	padding-left:18px;
	}
span{

	display:block;
	height:18px;}
-->
</style>
</head>

<body>
<script language = "JavaScript">   
 var onecount;   
 onecount=0;   
 subcat = new Array();   
 <?php foreach ($smallclass as $sc){?>
 subcat[<?php echo $count;?>] = new Array("<?php echo $sc['Id'];?>","<?php echo $sc['sc_name'];?>","<?php echo $sc['bc_id'];?>");   
 <?   
 $count++;   
 }
 echo "onecount=$count;";   
 ?>
 //联动函数   
 function changelocation(locationid)   
 {   
 document.form1.smallclass.length = 0;    
 var locationid=locationid;   
 var i;   
 for (i=0;i < onecount; i++)   
        {   
          if (subcat[i][2] == locationid)   
          {    
    //var newOption1=new Option(subcat[i][1], subcat[i][0]);   
             //document.all.ctype.add(newOption1);   
             document.form1.smallclass.options[document.form1.smallclass.length] = new Option(subcat[i][1], subcat[i][0]);   
          }          
        }   
          
 }    
 </script>
 <script language = "JavaScript">  
 function checkdata() {
	if( document.form1.bigclass.value == '') {
		alert("\请选择文章所属类别！");
		document.form1.bigclass.focus();
		return false;
	}
	if( document.form1.title.value=='') {
		alert("\文章标题不能为空！");
		document.form1.title.focus();
		return false;
		}
	if( document.form1.userfile.value!='') {
		document.form1.fileisok.value=0;
		}
	return true;
	}
 </script>
<div><form action="<?php echo $action;?>" method="post" name="form1" enctype="multipart/form-data" onsubmit="return checkdata();" >
<p class="text">新增文章</p>
<dl><dd style="border-top:1px #D1DAE3 solid;padding-top:15px;">
  <span>文章分类：</span><select name="bigclass" onChange="changelocation(document.form1.bigclass.options[document.form1.bigclass.selectedIndex].value)">
  <option selected value="">请指定主分类</option>         
 <?php   
	foreach($bigclass as $bc){
 ?>   
 <option value="<?php echo $bc['Id']; ?>"><?php echo $bc['bc_name']; ?></option>   
    <?php } ?>   
          
    </select>&nbsp;
  <select name="smallclass">
  <option selected value="">请指定小分类</option>
  </select> 
  * 必选项，小类别如无可不选</dd>
<dd>
  <span>标题：</span><input name="title" type="text" maxlength="25" style="width:220px;"/> 
  * 必填项，25字以内</dd>
<dd>
  <span>出处/作者：</span>
    <input name="author" type="text" maxlength="25" style="width:100px;"/>
</dd>
<dd>
  <span>首页标题图片：</span>
    <input name="userfile" type="file" maxlength="25"/> （仅针对医院资讯和健康资讯栏目，JPG或GIF格式，文件不得大于300K）
	<input name="fileisok" type="hidden" value="">
</dd>
<dd>
<span>文章摘要（100字以内）：</span>
  <textarea name="summary" cols="" rows="3" style="width:400px;height:40px;"></textarea>
</dd>
<dd><span>文章内容：</span><?php echo $editor; ?></dd>
<dd style="height:50px;"><div style="width:400px;float:left"><span>文章标签及相关医院（标签请用逗号，分割）：</span>
  <input name="tags" type="text" maxlength="25" />&nbsp; 
  <select name="hospital">
      <option value="">请选择文章相关医院</option>
      <?php foreach ($hospital as $r){?>
      <option value="<?php echo $r['hs_id'] ?>"><?php echo $r['name'] ?></option>
      <?php }?></select></div>
	  <div style="width:100px;float:left;padding-left:140px;"><input name="submit1" type="submit" value="提交文章" style="height:40px;width:80px;line-height:40px;" /></div>
</dd>
<dd style="border-bottom:1px #D1DAE3 solid;"></dd>
</dl>
</form>
</div>

</body>
</html>
